package com.xingceng.stock.config;

import com.google.common.util.concurrent.RateLimiter;
import com.xingceng.stock.properties.LimiterProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zby
 * @created 2024-06-25 10:44
 * @description id 生成器
 */
@Configuration
@SuppressWarnings("all")
public class RateLimiterConfiguration {

    @Bean
    public RateLimiter rateLimiter(LimiterProperties properties){
        return RateLimiter.create(properties.getConcurrentNum());
    }

}